<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">{{pageTitle}}</view>
			<view class="back"></view>
			<!-- <view class="rule">规则</view> -->
		</view>
		<view class="clear_box"></view>

		<view class="page_content">
			<block v-for="(item, index) in list" :key="index">
				<view class="list_box">
					<view class="zuob">
						<view class="img">
							<image src="../../static/menu/menu11.png" mode="widthFix"></image>
						</view>
						<view>
							<view class="name">
								<span v-if="item.p_type == 1">USDT/YYDM</span>
								<span v-if="item.p_type == 2">USDT/YYDZ</span>
								<span v-if="item.p_type == 3">YYDM/USDT</span>
								<span v-if="item.p_type == 4">YYDM/YYDZ</span>
								<span v-if="item.p_type == 5">YYDZ/YYDM</span>
							</view>
							<view class="time">{{item.add_time}}</view>
						</view>
					</view>
					<view class="youb">
						<view class="figure">-{{item.num}}</view>
						<view class="unit">+{{item.real_num}}</view>
					</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle: '',
				lang: 'en',
				link: '',
				pupu: false,
				scrrol: false,
				info: '',
				id: 0,
				list: [],
				page: 0
			}
		},
		onLoad() {
			this.loadData();
		},
		onShow() {

		},
		methods: {
			loadData() {
				let that = this;
				that.page = 0;
				that.list = [];
				that.loadPageData();
			},
			loadPageData() {
				let that = this;
				that.page++;
				that.Net._post('api/wallet/exchangeDetails', {
					page: that.page
				}, res => {
					if (res.code == 200) {
						that.list = that.list.concat(res.data.list); //将数据拼接在一起
					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
		onReachBottom() {
			let that = this;
			that.loadPageData()
		},
	}
</script>

<style>
	.header {
		background-color: transparent !important;
	}

	.header .text {
		text-align: center;
	}

	.page_content {
		width: 92%;
		margin: 0 auto;
	}

	.scrrolHeader {
		width: 100%;
		background-color: #1A1A1A !important;

	}

	.list_box {
		background-color: #1A1A1A;
		width: 100%;
		padding: 4vw 3vw;
		margin: 4% auto 0vw;
		border-radius: 4vw;
		display: flex;
		justify-content: space-between;
	}

	.list_box .zuob {
		display: flex;
	}

	.list_box .img {
		width: 11vw;
		margin-right: 2vw;
	}

	.list_box .img image {
		width: 100%;
	}

	.list_box .name {
		color: #fff;
		font-size: 4vw;
		font-weight: bold;
	}

	.list_box .time {
		color: #919191;
		font-size: 3vw;
		margin-top: 1vw;
	}

	.list_box .youb {
		text-align: right;
	}

	.list_box .figure {
		color: #F95657;
		font-size: 5vw;
		font-weight: bold;
	}

	.unit {
		color: #919191;
		font-size: 3vw;
	}
</style>